﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Sms_Customer_View.aspx.cs" Inherits="JKF.Web.SMS.Sms_Customer_View" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <%= RegScript("~/js/jquery.1.5.js")%>
    <%= RegScript("~/js/jquery.nhis.js")%>
    <%= RegScript("~/js/jquery.rchis.js")%>
    <%= RegScript("~/js/jquery-ui-custom.min.js")%>
    <%= RegScript("~/js/jquery.json.js")%>
    <%= RegScript("~/js/css.js")%>
    <%= RegScript("~/js/DatePicker/WdatePicker.js")%>
    <%= RegScript("~/js/Common.js")%>
    <%= RegScript("~/js/Jquery.commonGrid.js")%>
    <%= RegStyle("~/App_Themes/Theme2/Include.css")%>
    <script type="text/javascript">
        var AppPath = '<%=AppPath %>';
        var customerKey = "<%=CustomerKey%>";
        var handler = AppPath + '/do/SMS/SmsModule.do';
        var tmpl = new DTemplate();
        var PageSize = 20;
        var pager = null;
        var advSearch = null;
        var rowTemplate = "<tr><td>${CARD_NO}</td><td>${CUSTOMER_NAME}</td><td>${MOBILE}</td><td>${CONTENT}</td><td>${OPERATOR}</td><td>${DATE_SEND}</td><td>${STATUS_NAME}</td><td>${REASON_FAILURE}</td></tr>";
        $(function () {
            $.post(AppPath + handler, {
                ActionName: 'GetSendLogsByCustomer',
                customerKey: customerKey
            }, function (data) {
                if (data.Success) {
                    var tbody = $('#tb tbody');
                    tbody.empty();
                    if (data && data.Data && data.Data.length) {
                        $(data.Data).each(function () { this.CanSend = /^\d{6,15}$/.test(this.MOBILE) ? "" : "none"; });
                        tbody.html(tmpl(rowTemplate, data.Data, true));
                    } else {
                        tbody.html('<tr><td colspan="9" style="text-align: center">没有数据!</td></tr>');
                    }
                } else alert(data.Message);
                //$("#tb").H8_Grid($("#divPager"), 400);
            }, "json");
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="index_table">
            <table id="tb" class="common_table" style="width: 99%; margin: 0px auto;">
                <thead>
                    <tr>
                        <th width="90px" ordertype="string">卡号</th>
                        <th width="100px" ordertype="string">姓名</th>
                        <th width="90px" ordertype="string">手机号</th>
                        <th width="220px" ordertype="string">短信内容</th>
                        <th width="80px" ordertype="string">发送人</th>
                        <th width="80px" ordertype="string">发送时间</th>
                        <th width="80px" ordertype="string">发送状态</th>
                        <th width="150px" ordertype="string">发送失败原因</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td colspan="10" style="text-align: center">点击搜索查看数据</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </form>
</body>
</html>
